package com.ljh.common.config;

import com.ljh.common.utils.RedisUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @author: Themberfue
 * @date: 2025/4/24 11:05
 * @description:
 */
@Configuration
@ConditionalOnClass(StringRedisTemplate.class)
public class RedisUtilConfig {
    @Bean
    @ConditionalOnProperty(prefix = "spring.data.redis", name = "host")
    public RedisUtil redisUtil(StringRedisTemplate stringRedisTemplate) {
        return new RedisUtil(stringRedisTemplate);
    }
}
